package com.cmcc.groupcontacts.firewall.dao;

import com.cmcc.groupcontacts.firewall.dao.model.BaseModel;
import com.cmcc.groupcontacts.firewall.dao.model.FilterListVO;

/**
 * 黑白名单DAO
 * 
 * @author 
 * 
 */
public class FilterListDAO extends BaseDAO<FilterListVO> {
	public static String TABLE_NAME = "filter_list";

	public FilterListDAO() {
		super(TABLE_NAME);
	}
	
	@Override
	protected FilterListVO getInstance() {
		return new FilterListVO();
	}

	@Override
	protected String[] getBeanAllCols() {
		return FilterListVO.MetaData.ALL_COLS;
	}

	@Override
	protected void afterGetColValue(BaseModel bean, String colName, String value) {
		FilterListVO callList = (FilterListVO) bean;
		if (FilterListVO.MetaData.ID.equals(colName))
			callList.setId(Integer.valueOf(value));
		else if (FilterListVO.MetaData.NUMBER.equals(colName))
			callList.setNumber(value);
		else if (FilterListVO.MetaData.NAME.equals(colName))
			callList.setName(value);
		else if (FilterListVO.MetaData.TYPE.equals(colName))
			callList.setType(Integer.valueOf(value));
		else if (FilterListVO.MetaData.CALL_STATE.equals(colName))
			callList.setCallState(Integer.valueOf(value));
		else if (FilterListVO.MetaData.SMS_STATE.equals(colName))
			callList.setSmsState(Integer.valueOf(value));
	}
}
